//go:build wireinject
// +build wireinject

package inject

import (
	"gitee.com/ddlin/tiktok-go-tool/app"
	"gitee.com/ddlin/tiktok-go-tool/config"
	"gitee.com/ddlin/tiktok-go-tool/conn"
	"gitee.com/ddlin/tiktok-go-tool/internal/handler"
	"gitee.com/ddlin/tiktok-go-tool/internal/router"
	"github.com/google/wire"
)

func InitApp() (healthy *app.App, cleanup func(), err error) {
	wire.Build(
		config.ParseConfig,
		ProvideLogger,
		ProvideTracer, //保证生成的 tracer 在文件wire_gen.go中的最前面
		app.WireSet,
		router.WireSet,
		handler.WireSet,
		conn.WireSet,
	)
	return &app.App{}, nil, nil
}
